import * as THREE from "three";
import {OrbitControls} from "three/examples/jsm/controls/OrbitControls";
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader'
let isInit=false
let isBeforeRender=true;
export default class Base3d {
  constructor(props) {
    this.app=window.app
    this.camera=this.app.camera;
    this.scene=this.app.scene;
    this.controls=this.app.controls;
    this.renderer=this.app.renderer;
    this.light=this.app.light;
    window.controls=this.app.controls;
    window.camera=this.camera;
    this.scenes=this.app.scenes;
    this.lightScene=this.scenes['lightScene']
    this.init();
  }
  init(){

  }
  createComposer(composer){
    window.app.singleTon().addComposer(composer)
  }
  render(){
    if (isBeforeRender){
      isBeforeRender=false;
      window.app.trigger("ON_WEBGL_LOAD")
    }
    requestAnimationFrame( this.render.bind(this) );
  }
}
